﻿@model List<TMall.ManageSite.ViewModel.RoleVM>
@using (Html.BeginForm("Index", "Role", FormMethod.Post, new { @id = "pagerForm" }))
{
    @Html.Hidden("PageIndex", "1")
    @Html.Hidden("PageSize", "20")
    @Html.Hidden("OrderField", "Sort")
    @Html.Hidden("OrderDirection", "asc")
}
@{var navId = ViewBag.navId;}
<div class="pageHeader">
    <form onsubmit="return navTabSearch(this);" action="@Url.Action("Index")"  method="post">
    @Html.Hidden("navId")
    <div class="searchBar">
        <table class="searchContent">
            <tr>
                <td>
                    角色名称：@Html.TextBox("RoleName", ViewData["RoleName"]).ForSearch(QueryMethod.Like)
                </td>
                <td>
                    角色状态： @Html.DropDownList("StatusDB", ViewBag.StatusList as List<SelectListItem>).ForSearch(QueryMethod.Equal)
                </td>
            </tr>
        </table>
        <div class="subBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit">
                                检索</button></div>
                    </div>
                </li>
            </ul>
        </div>
    </div>
    </form>
</div>
<div class="pageContent">
    <div class="panelBar">
        <ul class="toolBar">
            <li>
                @Html.ActionLinkEx("添加", ViewData["navId"].ToString(), "Add", new { @class = "add", @target = "dialog", @title = "添加角色", @rel = "role", @fresh = "false", @width = "560", @height = "255" })
            </li>
            <li>
                @Html.ActionLinkEx("编辑", ViewData["navId"].ToString() + "/{sid_menu}", "Update", new { @class = "edit", @target = "dialog", @title = "编辑角色", @rel = "role", @fresh = "true", @width = "560", @height = "255" })
            </li>
            <li>
                @Html.ActionLinkEx("删除", ViewData["navId"].ToString() + "/{sid_menu}", "Delete", new { @class = "delete", @target = "ajaxTodo", @title = "确定要删除该角色吗?" })
            </li>
            <li>
                @Html.ActionLinkEx("绑定权限", ViewData["navId"].ToString() + "?type=fullview", "BindIndex", new { @class = "icon", @target = "navTab", @rel = "bindedpermission", @fresh = "false", @title = "绑定权限" })
            </li>
            <li class="line">line</li>
        </ul>
    </div>
    <table class="table" width="100%" layouth="137">
        <thead>
            <tr>
                <th width="60" align="left">
                    角色名称
                </th>
                <th width="50" align="left">
                    状态
                </th>
                <th width="100" align="left">
                    描述
                </th>
                <th width="100" align="left">
                    创建时间
                </th>
                <th width="60" align="left">
                    操作
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var x in Model)
            {
                <tr target="sid_menu" rel="@x.SysNo">
                    <td>
                        @x.RoleName
                    </td>
                    <td>
                        @x.Status.GetDescription()
                    </td>
                    <td>
                        @x.Description
                    </td>
                    <td>
                        @x.CreateDate.Format()
                    </td>
                    <td>
                        @Html.ActionLinkEx("删除", ViewData["navId"].ToString() + "/" + x.SysNo, "Delete", new { @class = "btnDel", @target = "ajaxTodo", @title = "确定要删除该角色吗?" })
                        @Html.ActionLinkEx("编辑", ViewData["navId"].ToString() + "/" + x.SysNo, "Update", new { @class = "btnEdit", @target = "dialog", @title = "编辑角色", @rel = "role", @fresh = "true", @width = "560", @height = "270" })
                        @Html.ActionLinkEx("绑定权限", ViewData["navId"].ToString() + "/" + x.SysNo + "?type=simpleview", "BindPermission", new { @class = "btnAdd", @target = "dialog", @rel = "bindedpermission", @fresh = "true", @title = "绑定权限", @width = "765", @height = "505" })
                    </td>
                </tr>
            }
        </tbody>
    </table>
    <div class="panelBar">
        <div class="pages">
            <span>显示</span>
            @Html.DropDownList("PageSize", new List<SelectListItem>(){ 
                  new SelectListItem(){  Value="10" ,Text="10"},
                  new SelectListItem(){  Value="15" ,Text="15"},
                  new SelectListItem(){  Value="20" ,Text="20"},
                  new SelectListItem(){  Value="30", Text="30"}
             }, new { @onchange = "navTabPageBreak({numPerPage:this.value})", @class = "combox" })
            <span>条，共@{@ViewBag.TotalCount}
                条</span>
        </div>
        <div class="pagination" targettype="navTab" totalcount="@ViewBag.TotalCount" numperpage="@ViewBag.PageSize" pagenumshown="10"
            currentpage="@ViewBag.PageIndex">
        </div>
    </div>
</div>
